class Solution:
    def lengthOfLIS(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        n = len(nums)
        if n == 0:
            return 0
        f = [1] * (n)
        for i in range(1, n):
            for j in range(0, i):
                if nums[i] > nums[j]:
                    f[i] = max(f[i], f[j] + 1)
        print(f)
        return max(f)


n = [1,3,5,4,7]
s=Solution()
print(s.lengthOfLIS(n))